package com.qf.service.impl;

import com.qf.constant.CacheConstants;
import com.qf.feign.CacheFeign;
import com.qf.model.StandardSubmit;
import com.qf.service.FilterChainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @author Zwnan
 */
@Service("black")
public class BlackFilterServiceImpl implements FilterChainService {

    @Autowired
    private CacheFeign cacheFeign;
    @Override
    public boolean stratrgy(StandardSubmit submit) {

        String s = CacheConstants.CACHE_PREFIX_BLACK + submit.getDestMobile();
        String value = cacheFeign.get(s);
        if (StringUtils.isEmpty(value)){
            return true;
        }else {
            return false;
        }
    }
}
